# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.EventTag do
  @moduledoc """
  Contains properties of an event tag.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Account ID of this event tag. This is a read-only field that can be left blank.
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Advertiser ID of this event tag. This field or the campaignId field is required on insertion.
  *   `advertiserIdDimensionValue` (*type:* `GoogleApi.DFAReporting.V4.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of the advertiser. This is a read-only, auto-generated field.
  *   `campaignId` (*type:* `String.t`, *default:* `nil`) - Campaign ID of this event tag. This field or the advertiserId field is required on insertion.
  *   `campaignIdDimensionValue` (*type:* `GoogleApi.DFAReporting.V4.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of the campaign. This is a read-only, auto-generated field.
  *   `enabledByDefault` (*type:* `boolean()`, *default:* `nil`) - Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads.
  *   `excludeFromAdxRequests` (*type:* `boolean()`, *default:* `nil`) - Whether to remove this event tag from ads that are trafficked through Display & Video 360 to Ad Exchange. This may be useful if the event tag uses a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this event tag. This is a read-only, auto-generated field.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTag".
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this event tag. This is a required field and must be less than 256 characters long.
  *   `siteFilterType` (*type:* `String.t`, *default:* `nil`) - Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites.
  *   `siteIds` (*type:* `list(String.t)`, *default:* `nil`) - Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a allowlist or blocklist filter.
  *   `sslCompliant` (*type:* `boolean()`, *default:* `nil`) - Whether this tag is SSL-compliant or not. This is a read-only field.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field.
  *   `subaccountId` (*type:* `String.t`, *default:* `nil`) - Subaccount ID of this event tag. This is a read-only field that can be left blank.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field.
  *   `url` (*type:* `String.t`, *default:* `nil`) - Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion.
  *   `urlEscapeLevels` (*type:* `integer()`, *default:* `nil`) - Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :advertiserId => String.t() | nil,
          :advertiserIdDimensionValue => GoogleApi.DFAReporting.V4.Model.DimensionValue.t() | nil,
          :campaignId => String.t() | nil,
          :campaignIdDimensionValue => GoogleApi.DFAReporting.V4.Model.DimensionValue.t() | nil,
          :enabledByDefault => boolean() | nil,
          :excludeFromAdxRequests => boolean() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :siteFilterType => String.t() | nil,
          :siteIds => list(String.t()) | nil,
          :sslCompliant => boolean() | nil,
          :status => String.t() | nil,
          :subaccountId => String.t() | nil,
          :type => String.t() | nil,
          :url => String.t() | nil,
          :urlEscapeLevels => integer() | nil
        }

  field(:accountId)
  field(:advertiserId)
  field(:advertiserIdDimensionValue, as: GoogleApi.DFAReporting.V4.Model.DimensionValue)
  field(:campaignId)
  field(:campaignIdDimensionValue, as: GoogleApi.DFAReporting.V4.Model.DimensionValue)
  field(:enabledByDefault)
  field(:excludeFromAdxRequests)
  field(:id)
  field(:kind)
  field(:name)
  field(:siteFilterType)
  field(:siteIds, type: :list)
  field(:sslCompliant)
  field(:status)
  field(:subaccountId)
  field(:type)
  field(:url)
  field(:urlEscapeLevels)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.EventTag do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.EventTag.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.EventTag do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
